<template>
	<view>
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30" style="padding-top: 20rpx;">
			<view class="u-m-r-10">
				<u-avatar :src="userInfo.avatarUrl" size="140"></u-avatar>
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20" style="font-size: 30rpx;padding-left: 20rpx;">{{use.name}}</view>
				<view class="u-font-18 u-p-b-20" style="font-size: 30rpx;padding-left: 20rpx;">{{use.idcardType}}</view>
				<!-- <view class="u-font-14 u-tips-color">微信号:helang_uView</view> -->
			</view>
			<view class="u-m-l-10 u-p-10">
				<!-- <u-icon name="scan" color="#969799" size="28"></u-icon> -->
			</view>
			<view class="u-m-l-10 u-p-10">
				<!-- <u-icon name="arrow-right" color="#969799" size="28"></u-icon> -->
			</view>
		</view>
		
		<view class="u-m-t-20" @click="showbox">
			<u-cell-group >
				<u-cell-item icon="rmb-circle" title="实名认证" ></u-cell-item>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20" @click="goCard">
			<u-cell-group>
				<u-cell-item icon="star" title="收藏"></u-cell-item>
<!-- 				<u-cell-item icon="photo" title="相册"></u-cell-item>
				<u-cell-item icon="coupon" title="卡券"></u-cell-item>
				<u-cell-item icon="heart" title="关注"></u-cell-item> -->
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20"  @click="goCard">
			<u-cell-group>
				<u-cell-item icon="setting" title="设置"></u-cell-item>
			</u-cell-group>
		</view>
		<u-modal v-model="show" :show-title='false'>
			<view class="slot-content">
				<view style="margin: 50rpx;">
					{{content}}<br/><br/>
					{{content1}}
				</view>
<!-- 				<rich-text :nodes="content" ></rich-text> -->
			</view>
		</u-modal>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pic:'https://uviewui.com/common/logo.png',
				show:false,
				content:'',
				content1:'',
				userInfo:{},
				use:{
					name:'',
					idcard:'',
					tel: '',
					idcardType: '',
					busesNumber: '',
					creditRating:  '',
				},
			}
		},
		onLoad() {
			let that =this
			uni.getStorage({
			    key: 'userInfo',
			    success: function (res) {
			        console.log(res);
					that.userInfo = res.data
			    }
			});
		},
		methods: {
			showbox(){
				this.show = true;
				this.content = '身份证号:'+this.use.idcard
				this.content1 = '手机号:'+this.use.tel
			},
			goCard(){
			     this.$refs.uToast.show({
					title: '功能尚未开放,敬请关注!',
					type: 'warning', 
				})
			}
		},
		onShow(){
			let _that =this
			uni.getStorage({
			    key: 'user',
			    success: function (res) {
					_that.use = res.data;	
			    }
			});
		}
	}
</script>

<style lang="scss">
page{
	background-color: #ededed;
}

.camera{
	width: 54px;
	height: 44px;
	
	&:active{
		background-color: #ededed;
	}
}
.user-box{
	background-color: #fff;
}
</style>
